//
//  BaseViewController.m
//  HengYouCai
//
//  Created by ycgwl on 2017/4/26.
//  Copyright © 2017年 lwj. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController
- (void)viewWillAppear:(BOOL)animated
{
    
    [super viewWillAppear:animated];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
//    self.navigationController.navigationBar.backIndicatorImage = [UIImage imageNamed:@"back"];
    self.navigationController.navigationBar.tintColor = Normal_333Color;
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:Normal_333Color};
    // 导航栏透明
//    self.navigationController.navigationBar.backg
    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];//如果放图片的话 会导致下个界面自动下沉
    self.navigationController.navigationBar.shadowImage = nil;
    self.navigationController.navigationBar.subviews.firstObject.alpha = 1;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    

    
}

/**
 *  dimiss页面
 */
- (void)dismissVC{
    if (self.navigationController) {
        [self.navigationController dismissViewControllerAnimated:YES completion:nil];
    }else{
        [self dismissViewControllerAnimated:YES completion:nil];

        
    }
}
/**
 *  pop页面
 */
- (void)popTheVC{
    [self.navigationController popViewControllerAnimated:YES];
}

/**
 *返回任意一个页面
 */
- (void)popToViewControllerAtIndex:(NSInteger)index{
    if (self.navigationController.viewControllers.count > index) {
        [self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:index] animated:YES];
    }
}
@end
